// Only modify this file to include
// - function definitions (prototypes)
// - include files
// - extern variable definitions
// In the appropriate section

#ifndef Slottimer_H_
#define Slottimer_H_
#include "Arduino.h"
//add your includes for the project Slottimer here


//end of add your includes here
#ifdef __cplusplus
extern "C" {
#endif
void loop();
void setup();
#ifdef __cplusplus
} // extern "C"
#endif

//add your function definitions for the project Slottimer here

char Version[10] = "1.1";
const int indicatorLED = 13;	// indicates sensor 
const int greenLED     = 36;
const int yellowLED    = 38;
const int redLED       = 40;
const int jumpstartLED = 13;	// todo: change to external led

// RaceStatus
const int RS_STOPPED   = 1;
const int RS_STARTED   = 2;
const int RS_RUNNING   = 3;
const int RS_FINISHED  = 4;
const int RS_MENU      = 5;
const int RS_RACEMENU  = 6;
const int RS_SETUPMENU = 7;
const int RT_LAPS      = 1;
const int RT_TIME      = 2;

// initialization
const int EnterButtonPin = 44;
const int CancelButtonPin = 46;
const int SelectButtonLeftPin = 48;
const int SelectButtonRightPin = 50;
int EnterBtn;
int CancelBtn;
int SelectBtnLeft;
int SelectBtnRight;
const unsigned long shortestPossibleLaptime = 3000; // prevent more than one sensor triggers - should be << fastest possible lap time ;)
unsigned long fastestLapTime;
int MenuIndex = 0;
int RaceStatus;
int playernr;
int racetype;
int lapsToRace;		// race for x laps
int timeToRace;		// race for x minutes - not implemented yet
int position;

// prototypes
void irSlot1();
void irSlot2();
void irSlot3();
void irSlot4();
void showMenuIndex(int index);
void drawMenuFrame(int rs);
void setfastestLap(unsigned long oldfastestLapTime);
unsigned long getfastestLap();
void showFastestLap();
void showSetupData(int laps, int time);
void updateRace();
void showRaceResults(int index);

//Do not add code below this line
#endif /* Slottimer_H_ */
